import axios from '@/libs/api.request'
import config from '@/config'

export const getSaleTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.view',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getSaleView = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.count',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getRankTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.orderUser',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getAnalysisTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'CustomerService.list',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getSaleAnalysisTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.saleAna',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getProductAnalysisTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.productAna',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getMonthSaleRank = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.sellMoneyOrder',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getWantOrderRank = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.wantOrder',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getComeOrderRank = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.comeOrder',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getSellOrderRank = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.sellOrder',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const getUnsellOrderRank = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'ManageService.unSellOrder',
      ...playload
    },
    method: 'get'
  })
  return resp
}
